<extend name="layout/main" />

<block name="HEADER">
	<style type="text/css">
		#grid .layui-table-view .layui-table td .layui-table-cell{
			height: 50px;
		    line-height: 50px;
		}
		#grid .file-img {
		    height: 100%;
		    background-position: left;
		    background-size: 100% 85%;
		    background-repeat: no-repeat;
		    cursor: pointer;
		}
	</style>
</block>

<block name="CONTENT">
	<div class="wrapper">
		<div class="panel-heading">
			<control:search id="searchs" />
		</div>
		<div class="content">
			<control:grid id="grid" padding="0" height="100%" />
		</div>
	</div>
	
	
	<!--驳回-->
	<script id="tpl-reject" type="text/html">
		<form class="layui-form J-changeStatus">
			<table class="xw-table">
				<tr>
					<th width="80"></th><th></th>
					<th width="80"></th><th></th>
				</tr>
				<tr>
					<td class="f-orage"  style="vertical-align: top;">驳回原因</td>
					<td colspan="3">
				    	<textarea name="desc" placeholder="请输入驳回原因" class="layui-textarea" datatype="*" style="min-height: 155px;"></textarea>
					</td>
				</tr>
			</table>
		</form>
	</script>	
	
	
	<!--驳回明细-->
	<script id="tpl-reject-detail" type="text/html">
		<form class="layui-form J-changeStatus">
			<table class="xw-table">
				<tr>
					<th width="80"></th><th></th>
					<th width="80"></th><th></th>
				</tr>
				<tr>
					<td class="f-orage"  style="vertical-align: top;">驳回原因</td>
					<td colspan="3">
				    	<textarea name="desc" disabled placeholder="请输入驳回原因" class="layui-textarea" datatype="*" style="min-height: 155px;">{{data.status_desc}}</textarea>
					</td>
				</tr>
			</table>
		</form>
	</script>	
	
</block>

<block name="FOOTER">
	<script type="text/javascript">
		var page = (function(ns){
     
		    //页面初始化
		    ns.init=function(){
		        ns.query();
		    }
		    
		    //搜索事件
		    ns.query=function(){
		    	grid.load( searchs.getData() );
		    }
		    
		    //新增
		    ns.add=function(){
		    	var filter = {
		            url:"modules/shop/notice/edit",
		            oid:"",
		            mode:1
		        }
		        $.openIframe(filter, "新增",['500px', '520px']);
		    }
		    
		    //编辑
		    ns.edit=function(){
		    	var selectedRow = grid.getSelectedRows()[0];
		        var filter = {
		            url:"modules/shop/notice/edit",
		            oid: selectedRow.id ,
		            mode:2
		        }
		        $.openIframe(filter, "编辑",['650px', '500px']);
		    }  
		    
		    //删除
		    ns.del =function(){
		    	if( !grid.isSelected() ){
		    		return false;
		    	}
		    	$.confirm("确定删除？", function(){
		    		$.ajaxs('/admin/v3/msg/delSystemMsg',{
			    		ids:grid.getSelectedColumnValue('id')
			    	},function(res){
			    		$.toast(1,"已删除！");
			    		grid.load();
			    	});
		    	});
		    }
		    
		    return ns;
		}({}));
		
		
		$(function(){ page.init();  });
	</script>
</block>